package com.qiche.service;

import java.util.List;

import com.github.pagehelper.PageInfo;
import com.qiche.aspect.Result;
import com.qiche.dto.SimpleInsurancePolicyItemDto;
import com.qiche.exception.MySystemException;
import com.qiche.model.InsurancePolicy;
import com.qiche.requestpram.PolicyListURL;
import com.qiche.model.User;

/**
 * Created by Linzw on 2018/01/24.
 */
public interface InsurancePolicyService extends IService<InsurancePolicy>{
    PageInfo<InsurancePolicy> selectByPage(InsurancePolicy policy, int start, int length);

    InsurancePolicy selectById(Long id);

    Result<String> delInsurancePolicy(Long policyId);

	List<InsurancePolicy> selectByCustomerId(Long customerId);

	Result savePolicy(InsurancePolicy policy, User user) throws MySystemException;

	InsurancePolicy selectByCode(String code);

	Result updatePolicy(InsurancePolicy policy,User user) throws MySystemException;

	/**
	 * 小程序
	 * 	根据 参数查询 展示保单列表 分页
	 * @param policyListURL
	 * 					keyword 关键字 (保单号 or 车牌 or 车主 or 手机号)可以为null
	 * 					pageNum 起始页
	 * 					pageSize 一页展示数
	 * @return
	 */
	PageInfo<SimpleInsurancePolicyItemDto> selectByPolicyListURL(PolicyListURL policyListURL);

	/**
	 * 根据门店id查询,所有的保单(只有id,PolicyMoney,createTime字段)
	 * @param merchantId
	 * @return
	 */
	List<InsurancePolicy> selectPolicyMoneyAll(Integer merchantId);
	
	 List<InsurancePolicy> selectByMerchantId();
}
